<template>
    <div class="drawerContainer">
        <el-form :model="propJson" label-width="auto" style="width: 100%">
            <el-form-item label="绑定参数">
                <el-select v-model="propJson.bindVariable" placeholder="参数名称" style="width: 100%">
                    <el-option v-for="info in commonParam" :label="info.variableName" :value="info.variableName" />
                </el-select>
            </el-form-item>

            <el-form-item label="尺寸">
                <el-radio-group v-model="propJson.size">
                    <el-radio label="default">默认</el-radio>
                    <el-radio label="large">大号</el-radio>
                    <el-radio label="small">小号</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="是否禁用">
                <el-radio-group v-model="propJson.isDisable">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="是否设置最小值">
                <el-radio-group v-model="propJson.isMinNum">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="最小值" v-if="propJson.isMinNum">
                <el-input-number v-model="propJson.minNum" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="是否设置最大值">
                <el-radio-group v-model="propJson.isMaxNum">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="最大值" v-if="propJson.isMaxNum">
                <el-input-number v-model="propJson.maxNum" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="操作的步长">
                <el-input-number v-model="propJson.step" :min="1" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="是否只能输入步长的倍数">
                <el-radio-group v-model="propJson.stepStrictly">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="控制按钮位置">
                <el-radio-group v-model="propJson.controlsPosition">
                    <el-radio label="">左右两侧</el-radio>
                    <el-radio label="right">右侧</el-radio>
                </el-radio-group>
            </el-form-item>
        </el-form>
    </div>
</template>

<script name="InputNumberDrawer" setup lang="ts">
import {computed, defineProps} from "vue";
import {useLowCodeStore} from "@/stores/lowcode/lowcode";

let props = defineProps(['commonParam'])

let commonParam = computed(() => {return props['commonParam']})

let propJson = computed(() => {return useLowCodeStore().lowCodeDrawerJsonInfo});
</script>

<style scoped lang="less">

</style>